//
//  CalculatePanelView.m
//  Rong360
//
//  Created by tianliwei on 15/2/14.
//  Copyright (c) 2014 tianliwei. All rights reserved.
//

#import "CalculatePanelView.h"
#import <AudioToolbox/AudioToolbox.h>
#import <CoreFoundation/CoreFoundation.h>
@implementation CalculatePanelView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

- (IBAction)btnClicked:(id)sender {
    //播放声音
    [self playSound];
    
    [self.delegate keyBtnClicked:sender];
}

- (void) playSound {
    
    CFBundleRef mainBundle;
    SystemSoundID soundFileObject;
    mainBundle = CFBundleGetMainBundle ();
    
    // Get the URL to the sound file to play
    CFURLRef soundFileURLRef = CFBundleCopyResourceURL (mainBundle,CFSTR ("pia"),CFSTR ("mp3"),NULL);
    
    AudioServicesCreateSystemSoundID (soundFileURLRef,&soundFileObject);
    AudioServicesPlaySystemSound(soundFileObject);
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty 
 implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
